package exercise.day04;

import java.util.Scanner;

public class SwitchCaseDemo {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        System.out.println("请选择功能:1.取款 2.存款 3.查询余额 0 退卡");
        int command = scan.nextInt();
        switch (command) {
            case 1:
                System.out.println("取款操作");
                break;
            case 2:
                System.out.println("存款操作");
                break;
            case 3:
                System.out.println("查询余额操作");
                break;
            case 0:
                System.out.println("退出成功");
                break;
            default:
                System.out.println("输入错误");
        }
        System.out.println("-------switch(2)-----------");

        System.out.println("请选择商品：1.可乐 2.薯片 3.辣条 4.退出");
        int commodity = scan.nextInt();
        switch (commodity) {
            case 1:
                System.out.println("可乐");
                break;
            case 2:
                System.out.println("薯片");
                break;
            case 3:
                System.out.println("辣条");
                break;
            case 0:
                System.out.println("退出选择");
                break;
            default:
                System.out.println("输入错误");
        }
    }
}
